package com.miyake.client.datamanage;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.miyake.client.DataServiceAsync;

public class ImagePage extends Page {

	public ImagePage(NodeProperty node, VerticalPanel panel) {
		super(node, panel);
	}

	@Override
	protected Widget getContent(NodeProperty node, DataServiceAsync service) {
		final Image image = new Image();
		service.getImage(node.getKey(), new AsyncCallback<String>() {
			@Override
			public void onFailure(Throwable caught) {
			}

			@Override
			public void onSuccess(String result) {
				image.setUrl(result);
			}	
		});
		return image;
	}

}
